package Test;

import java.io.*;

import Course.course;
import People.student;
import People.teacher;

public class test {
    public static void main(String[] args) {

        student 小红 = new student(1211212, "小红", "女");
        teacher 小明= new teacher(1111, "小明", "男");
        teacher 小刚= new teacher(2222, "小刚", "男");
        course JAVA = new course(1, "JAVA", "教111", "周五10：00-12：00", "小红", 1);
        course Python = new course(2,"Python","实验室","周四1：30-3：30","小刚",2);
        小刚.addTeachCourse(Python);
        小明.addTeachCourse(JAVA);
        小红.chooseCourse(JAVA);
        小红.chooseCourse(Python);
        小红.displayCourse();
    
        //测试主类
        try {
            ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("experiment6"));
            oos.writeObject(小红);
            File f = new File("experiment6");
            ObjectInputStream ois = new ObjectInputStream(new FileInputStream(f));
            student newStudent1 = (student)ois.readObject();
            newStudent1.removeCourse(JAVA);
            System.out.println(newStudent1.toString());
        }
        catch (Exception e) {
            System.out.print("Error: " + e);
            System.exit(1);
        }
    }
}